#ifndef THREAD_H
#define THREAD_H

#include <vmm.h>
//#include <process.h>

#define	TH_NEW	1
#define TH_READY	2
#define	TH_RUNNING	3
#define	TH_WAITING	4
#define TH_ZOMBIE	5

typedef struct stack_st
{
	unsigned int bottom;
	unsigned int size;
}stack_i;

typedef struct stack_list_st
{
	stack_i *stack;
	struct stack_list_st *next;
}stack_list;

typedef struct thread_st
{
	unsigned int tid;
	unsigned int ptid;
	struct process_st *process;
	unsigned int state;
	unsigned int time;
	unsigned int stack;
	registers r;
	registers test;
	unsigned int v86_if;
	unsigned int v86_useresp, v86_ss, v86_cs, v86_eip, v86_eflags, v86_ds;
	registers v86_r;
	unsigned int message;
} thread;

thread *current_thread;
unsigned int next_tid;

#endif /* end of include guard: THREAD_H */
